import 'package:scoped_model/scoped_model.dart';
import 'package:flutter/material.dart';

abstract class BaseModel extends Model {
  final Map<String, Object> map = <String, Object>{};
  Object get(String key) => map[key];
  set(String key, Object object) {
     map[key] = object;
     return this;
  }
  static T of<T extends Model>(BuildContext context,[bool rebuildOnChange]){
     if(rebuildOnChange!=null)
        return ScopedModel.of<T>(context,rebuildOnChange: rebuildOnChange);
     return ScopedModel.of<T>(context);
  }
}
